home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource3
/
110_01
/
fib.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
Text File
|
1984-03-04
|
384 b
|
21 lines
/*
* Fibbonacchi series (?) benchmark run at Usenix Conference.
* For 16 bit integers, max argument without overflow is 25.
*/
main(argc,argv)
char **argv;
{
printf("%u\n", fib(atoi(argv[1])));
}
fib(p)
int p;
{
if(p==0)
return 0;
else if(p==1)
return 1;
else
return fib(p-1)+fib(p-2);
}